home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / tabvie.zip / TAB.CPP < prev    next >
C/C++ Source or Header  |  1994-04-11  |  3KB  |  103 lines

  1. // tab.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "tab.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "tabdoc.h"
  9. #include "mainview.h"
  10. #include "ctl3d.h"
  11. #include "about.h"
  12. #ifdef _DEBUG
  13. #undef THIS_FILE
  14. static char BASED_CODE THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CTabApp
  19.  
  20. BEGIN_MESSAGE_MAP(CTabApp, CWinApp)
  21.     //{{AFX_MSG_MAP(CTabApp)
  22.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  23.         // NOTE - the ClassWizard will add and remove mapping macros here.
  24.         //    DO NOT EDIT what you see in these blocks of generated code !
  25.     //}}AFX_MSG_MAP
  26.     // Standard file based document commands
  27.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  28.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  29. END_MESSAGE_MAP()
  30.  
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CTabApp construction
  33.  
  34. CTabApp::CTabApp()
  35. {
  36.     // TODO: add construction code here,
  37.     // Place all significant initialization in InitInstance
  38. }
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // The one and only CTabApp object
  42.  
  43. CTabApp NEAR theApp;
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CTabApp initialization
  47.  
  48. BOOL CTabApp::InitInstance()
  49. {
  50.        Ctl3dRegister     (m_hInstance);
  51.        Ctl3dAutoSubclass (m_hInstance);
  52.     // Standard initialization
  53.     // If you are not using these features and wish to reduce the size
  54.     //  of your final executable, you should remove from the following
  55.     //  the specific initialization routines you do not need.
  56.  
  57.     SetDialogBkColor();        // set dialog background color to gray
  58.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  59.     
  60.     EnableVBX();
  61.  
  62.     // Register the application's document templates.  Document templates
  63.     //  serve as the connection between documents, frame windows and views.
  64.  
  65.     AddDocTemplate(new CMultiDocTemplate(IDR_TABTYPE,
  66.             RUNTIME_CLASS(CTabDoc),
  67.             RUNTIME_CLASS(CMDIChildWnd),        // MDI child frame
  68.             RUNTIME_CLASS(CMainView)));
  69.  
  70.     // create main MDI Frame window
  71.     CMainFrame* pMainFrame = new CMainFrame;
  72.     if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  73.         return FALSE;
  74.     pMainFrame->ShowWindow(m_nCmdShow);
  75.     pMainFrame->UpdateWindow();
  76.     m_pMainWnd = pMainFrame;
  77.  
  78.     // create a new (empty) document
  79.     OnFileNew();
  80.  
  81.     if (m_lpCmdLine[0] != '\0')
  82.     {
  83.         // TODO: add command line processing here
  84.     }
  85.  
  86.     return TRUE;
  87. }
  88. int CTabApp::ExitInstance()
  89. {
  90.     Ctl3dUnregister (m_hInstance);
  91.     return CWinApp::ExitInstance();
  92. }
  93.  
  94. // App command to run the dialog
  95. void CTabApp::OnAppAbout()
  96. {
  97.     CAboutDlg aboutDlg;
  98.     aboutDlg.DoModal();
  99. }
  100.  
  101. /////////////////////////////////////////////////////////////////////////////
  102. // CTabApp commands
  103.